<script lang="ts" setup>
import { useUserStore } from "@/stores/user";
import { computed } from "vue";

const props = withDefaults(defineProps<{ btnPerm: string }>(), {
  btnPerm: "",
});
// 是否显示
const isShow = computed(() => {
  const store = useUserStore();
  const perms = store.profile.permissions;
  return perms.includes(props.btnPerm) || perms.includes("*:*:*");
});
</script>
<template>
  <slot v-if="isShow"></slot>
  <span v-else></span>
</template>
<style lang="scss"></style>
